﻿using com.ytocargo.Core.FlightPlanMakeLogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yto.Common.Dependency;

namespace com.ytocargo.Application.FlightPlanMakeLogs
{
    public class FlightPlanMakeLogServices : IFlightPlanMakeLogServices, ITransient
    {
        private readonly IFlightPlanMakeLogStore _flightPlanMakeLogStore;
        public FlightPlanMakeLogServices(IFlightPlanMakeLogStore flightPlanMakeLogStore)
        {
            _flightPlanMakeLogStore = flightPlanMakeLogStore;
        }

        public Task<List<FlightPlanMakeLog>> GetUnSengdListAsync(int maxCount)
        {
            return _flightPlanMakeLogStore.GetUnSengdListAsync(x => !x.SendFlag && x.InputOtherFlag.Value, maxCount);
        }

        public Task<FlightPlanMakeLog> UpdateFlightPlanMakeLogAsync(FlightPlanMakeLog flightPlanMakeLog)
        {
            return _flightPlanMakeLogStore.UpdateFlightPlanMakeLogAsync(flightPlanMakeLog);
        }
    }
}
